package com.mtz.dateobject;

import com.mtz.enums.DeleteEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * 问答表
 * @author 煜赜
 * @date 2018/11/21 10:01
 */
@Data
@Entity
@DynamicUpdate
@DynamicInsert
public class Question {

    /** 问题id **/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /** 知识类型 **/
    private Integer knowledgeType;

    /** 问题描述 **/
    private String question;

    /** 问题描述关键词 **/
    private String keyword;

    /** 答案描述 **/
    private Integer answerId;

    /** 信息状态(0未删除,1已删除) **/
    private Integer isDeleted = DeleteEnum.UN_CHECKED.getCode();

//    @JsonSerialize(using = Date2LongSerializer.class) //转成时间戳
    private Date createTime;

//    @JsonSerialize(using = Date2LongSerializer.class)
    private Date updateTime;
}
